const { sequelize } = require("@core/db");
const { Sequelize, Model } = require("sequelize");

class Notice extends Model {}

Notice.init(
  {
    notice_id: {
      type: Sequelize.INTEGER,
      primaryKey: true,
      autoIncrement: true,
    },
    is_on: {
      type: Sequelize.BOOLEAN,
      defaultValue: false,
      comment: "是否发布",
    },
    content: {
      type: Sequelize.TEXT,
      allowNull: false,
      comment: "内容",
    },
  },
  {
    sequelize,
    tableName: "notice",
  }
);

module.exports = {
  Notice,
};
